/**
 * Copyright (c) 2015-2017, Henry Yang 杨勇 (gismail@foxmail.com).
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.lambkit.module.cms.rpc.model.sql;

import com.lambkit.db.sql.ConditionMode;
import com.lambkit.db.sql.column.Column;
import com.lambkit.db.sql.column.Columns;
import com.lambkit.db.sql.column.Example;

import java.io.Serializable;
import java.util.List;

/**
 * @author yangyong 
 * @website: www.lambkit.com
 * @email: gismail@foxmail.com
 * @date 2020-02-23
 * @version 1.0
 * @since 1.0
 */
public class CmsRelationCriteria extends Columns implements Serializable {
	private static final long serialVersionUID = 1L;
	
	public static CmsRelationCriteria create() {
		return new CmsRelationCriteria();
	}
	
	public static CmsRelationCriteria create(Column column) {
		CmsRelationCriteria that = new CmsRelationCriteria();
		that.add(column);
        return that;
    }

    public static CmsRelationCriteria create(String name, Object value) {
        return (CmsRelationCriteria) create().eq(name, value);
    }
    
    public Example example() {
    	return Example.create("cms_relation", this);
    }
    
    /**
     * equals
     *
     * @param name
     * @param value
     * @return
     */
    public CmsRelationCriteria eq(String name, Object value) {
    	super.eq(name, value);
        return this;
    }

    /**
     * not equals !=
     *
     * @param name
     * @param value
     * @return
     */
    public CmsRelationCriteria ne(String name, Object value) {
    	super.ne(name, value);
        return this;
    }


    /**
     * like
     *
     * @param name
     * @param value
     * @return
     */

    public CmsRelationCriteria like(String name, Object value) {
    	super.like(name, value);
        return this;
    }
    
    public CmsRelationCriteria notLike(String name, Object value) {
    	super.notLike(name, value);
        return this;
    }

    /**
     * 大于 great than
     *
     * @param name
     * @param value
     * @return
     */
    public CmsRelationCriteria gt(String name, Object value) {
    	super.gt(name, value);
        return this;
    }

    /**
     * 大于等于 great or equal
     *
     * @param name
     * @param value
     * @return
     */
    public CmsRelationCriteria ge(String name, Object value) {
    	super.ge(name, value);
        return this;
    }

    /**
     * 小于 less than
     *
     * @param name
     * @param value
     * @return
     */
    public CmsRelationCriteria lt(String name, Object value) {
    	super.lt(name, value);
        return this;
    }

    /**
     * 小于等于 less or equal
     *
     * @param name
     * @param value
     * @return
     */
    public CmsRelationCriteria le(String name, Object value) {
    	super.le(name, value);
        return this;
    }
    
    public CmsRelationCriteria isnull(String name) {
    	super.isnull(name);
        return this;
    } 

    public CmsRelationCriteria notNull(String name) {
    	super.notNull(name);
        return this;
    } 
    
    public CmsRelationCriteria empty(String name) {
    	super.empty(name);
        return this;
    } 
    
    public CmsRelationCriteria notEmpty(String name) {
    	super.notEmpty(name);
        return this;
    } 
    
    public CmsRelationCriteria add(Column column) {
    	super.add(column);
    	return this;
    }
    
    /**************************/
	
	public void addCriterion(String name, Object value, ConditionMode logic, String property, String typeHandler, String valueType) {
		 if (value == null) {
			 throw new RuntimeException("Value for " + property + " cannot be null");
		 }
		 add(Column.create(name, value, logic, typeHandler, valueType));
	}
   
	public void addCriterion(String name, Object value1, Object value2, ConditionMode logic, String property, String typeHandler, String valueType) {
		 if (value1 == null || value2 == null) {
			 throw new RuntimeException("Between values for " + property + " cannot be null");
		 }
		 add(Column.create(name, value1, value2, logic, typeHandler, valueType));
	}
		 
	public CmsRelationCriteria andMainIdIsNull() {
		isnull("main_id");
		return this;
	}
	
	public CmsRelationCriteria andMainIdIsNotNull() {
		notNull("main_id");
		return this;
	}
	
	public CmsRelationCriteria andMainIdIsEmpty() {
		empty("main_id");
		return this;
	}

	public CmsRelationCriteria andMainIdIsNotEmpty() {
		notEmpty("main_id");
		return this;
	}
       public CmsRelationCriteria andMainIdEqualTo(java.lang.Long value) {
          addCriterion("main_id", value, ConditionMode.EQUAL, "mainId", "java.lang.Long", "Float");
          return this;
      }

      public CmsRelationCriteria andMainIdNotEqualTo(java.lang.Long value) {
          addCriterion("main_id", value, ConditionMode.NOT_EQUAL, "mainId", "java.lang.Long", "Float");
          return this;
      }

      public CmsRelationCriteria andMainIdGreaterThan(java.lang.Long value) {
          addCriterion("main_id", value, ConditionMode.GREATER_THEN, "mainId", "java.lang.Long", "Float");
          return this;
      }

      public CmsRelationCriteria andMainIdGreaterThanOrEqualTo(java.lang.Long value) {
          addCriterion("main_id", value, ConditionMode.GREATER_EQUAL, "mainId", "java.lang.Long", "Float");
          return this;
      }

      public CmsRelationCriteria andMainIdLessThan(java.lang.Long value) {
          addCriterion("main_id", value, ConditionMode.LESS_THEN, "mainId", "java.lang.Long", "Float");
          return this;
      }

      public CmsRelationCriteria andMainIdLessThanOrEqualTo(java.lang.Long value) {
          addCriterion("main_id", value, ConditionMode.LESS_EQUAL, "mainId", "java.lang.Long", "Float");
          return this;
      }

      public CmsRelationCriteria andMainIdBetween(java.lang.Long value1, java.lang.Long value2) {
    	  addCriterion("main_id", value1, value2, ConditionMode.BETWEEN, "mainId", "java.lang.Long", "Float");
    	  return this;
      }

      public CmsRelationCriteria andMainIdNotBetween(java.lang.Long value1, java.lang.Long value2) {
          addCriterion("main_id", value1, value2, ConditionMode.NOT_BETWEEN, "mainId", "java.lang.Long", "Float");
          return this;
      }
        
      public CmsRelationCriteria andMainIdIn(List<java.lang.Long> values) {
          addCriterion("main_id", values, ConditionMode.IN, "mainId", "java.lang.Long", "Float");
          return this;
      }

      public CmsRelationCriteria andMainIdNotIn(List<java.lang.Long> values) {
          addCriterion("main_id", values, ConditionMode.NOT_IN, "mainId", "java.lang.Long", "Float");
          return this;
      }
	public CmsRelationCriteria andMainTypeIsNull() {
		isnull("main_type");
		return this;
	}
	
	public CmsRelationCriteria andMainTypeIsNotNull() {
		notNull("main_type");
		return this;
	}
	
	public CmsRelationCriteria andMainTypeIsEmpty() {
		empty("main_type");
		return this;
	}

	public CmsRelationCriteria andMainTypeIsNotEmpty() {
		notEmpty("main_type");
		return this;
	}
        public CmsRelationCriteria andMainTypeLike(java.lang.String value) {
    	   addCriterion("main_type", value, ConditionMode.FUZZY, "mainType", "java.lang.String", "Float");
    	   return this;
      }

      public CmsRelationCriteria andMainTypeNotLike(java.lang.String value) {
          addCriterion("main_type", value, ConditionMode.NOT_FUZZY, "mainType", "java.lang.String", "Float");
          return this;
      }
      public CmsRelationCriteria andMainTypeEqualTo(java.lang.String value) {
          addCriterion("main_type", value, ConditionMode.EQUAL, "mainType", "java.lang.String", "String");
          return this;
      }

      public CmsRelationCriteria andMainTypeNotEqualTo(java.lang.String value) {
          addCriterion("main_type", value, ConditionMode.NOT_EQUAL, "mainType", "java.lang.String", "String");
          return this;
      }

      public CmsRelationCriteria andMainTypeGreaterThan(java.lang.String value) {
          addCriterion("main_type", value, ConditionMode.GREATER_THEN, "mainType", "java.lang.String", "String");
          return this;
      }

      public CmsRelationCriteria andMainTypeGreaterThanOrEqualTo(java.lang.String value) {
          addCriterion("main_type", value, ConditionMode.GREATER_EQUAL, "mainType", "java.lang.String", "String");
          return this;
      }

      public CmsRelationCriteria andMainTypeLessThan(java.lang.String value) {
          addCriterion("main_type", value, ConditionMode.LESS_THEN, "mainType", "java.lang.String", "String");
          return this;
      }

      public CmsRelationCriteria andMainTypeLessThanOrEqualTo(java.lang.String value) {
          addCriterion("main_type", value, ConditionMode.LESS_EQUAL, "mainType", "java.lang.String", "String");
          return this;
      }

      public CmsRelationCriteria andMainTypeBetween(java.lang.String value1, java.lang.String value2) {
    	  addCriterion("main_type", value1, value2, ConditionMode.BETWEEN, "mainType", "java.lang.String", "String");
    	  return this;
      }

      public CmsRelationCriteria andMainTypeNotBetween(java.lang.String value1, java.lang.String value2) {
          addCriterion("main_type", value1, value2, ConditionMode.NOT_BETWEEN, "mainType", "java.lang.String", "String");
          return this;
      }
        
      public CmsRelationCriteria andMainTypeIn(List<java.lang.String> values) {
          addCriterion("main_type", values, ConditionMode.IN, "mainType", "java.lang.String", "String");
          return this;
      }

      public CmsRelationCriteria andMainTypeNotIn(List<java.lang.String> values) {
          addCriterion("main_type", values, ConditionMode.NOT_IN, "mainType", "java.lang.String", "String");
          return this;
      }
	public CmsRelationCriteria andRelationIdIsNull() {
		isnull("relation_id");
		return this;
	}
	
	public CmsRelationCriteria andRelationIdIsNotNull() {
		notNull("relation_id");
		return this;
	}
	
	public CmsRelationCriteria andRelationIdIsEmpty() {
		empty("relation_id");
		return this;
	}

	public CmsRelationCriteria andRelationIdIsNotEmpty() {
		notEmpty("relation_id");
		return this;
	}
       public CmsRelationCriteria andRelationIdEqualTo(java.lang.Long value) {
          addCriterion("relation_id", value, ConditionMode.EQUAL, "relationId", "java.lang.Long", "Float");
          return this;
      }

      public CmsRelationCriteria andRelationIdNotEqualTo(java.lang.Long value) {
          addCriterion("relation_id", value, ConditionMode.NOT_EQUAL, "relationId", "java.lang.Long", "Float");
          return this;
      }

      public CmsRelationCriteria andRelationIdGreaterThan(java.lang.Long value) {
          addCriterion("relation_id", value, ConditionMode.GREATER_THEN, "relationId", "java.lang.Long", "Float");
          return this;
      }

      public CmsRelationCriteria andRelationIdGreaterThanOrEqualTo(java.lang.Long value) {
          addCriterion("relation_id", value, ConditionMode.GREATER_EQUAL, "relationId", "java.lang.Long", "Float");
          return this;
      }

      public CmsRelationCriteria andRelationIdLessThan(java.lang.Long value) {
          addCriterion("relation_id", value, ConditionMode.LESS_THEN, "relationId", "java.lang.Long", "Float");
          return this;
      }

      public CmsRelationCriteria andRelationIdLessThanOrEqualTo(java.lang.Long value) {
          addCriterion("relation_id", value, ConditionMode.LESS_EQUAL, "relationId", "java.lang.Long", "Float");
          return this;
      }

      public CmsRelationCriteria andRelationIdBetween(java.lang.Long value1, java.lang.Long value2) {
    	  addCriterion("relation_id", value1, value2, ConditionMode.BETWEEN, "relationId", "java.lang.Long", "Float");
    	  return this;
      }

      public CmsRelationCriteria andRelationIdNotBetween(java.lang.Long value1, java.lang.Long value2) {
          addCriterion("relation_id", value1, value2, ConditionMode.NOT_BETWEEN, "relationId", "java.lang.Long", "Float");
          return this;
      }
        
      public CmsRelationCriteria andRelationIdIn(List<java.lang.Long> values) {
          addCriterion("relation_id", values, ConditionMode.IN, "relationId", "java.lang.Long", "Float");
          return this;
      }

      public CmsRelationCriteria andRelationIdNotIn(List<java.lang.Long> values) {
          addCriterion("relation_id", values, ConditionMode.NOT_IN, "relationId", "java.lang.Long", "Float");
          return this;
      }
	public CmsRelationCriteria andRelationTypeIsNull() {
		isnull("relation_type");
		return this;
	}
	
	public CmsRelationCriteria andRelationTypeIsNotNull() {
		notNull("relation_type");
		return this;
	}
	
	public CmsRelationCriteria andRelationTypeIsEmpty() {
		empty("relation_type");
		return this;
	}

	public CmsRelationCriteria andRelationTypeIsNotEmpty() {
		notEmpty("relation_type");
		return this;
	}
        public CmsRelationCriteria andRelationTypeLike(java.lang.String value) {
    	   addCriterion("relation_type", value, ConditionMode.FUZZY, "relationType", "java.lang.String", "Float");
    	   return this;
      }

      public CmsRelationCriteria andRelationTypeNotLike(java.lang.String value) {
          addCriterion("relation_type", value, ConditionMode.NOT_FUZZY, "relationType", "java.lang.String", "Float");
          return this;
      }
      public CmsRelationCriteria andRelationTypeEqualTo(java.lang.String value) {
          addCriterion("relation_type", value, ConditionMode.EQUAL, "relationType", "java.lang.String", "String");
          return this;
      }

      public CmsRelationCriteria andRelationTypeNotEqualTo(java.lang.String value) {
          addCriterion("relation_type", value, ConditionMode.NOT_EQUAL, "relationType", "java.lang.String", "String");
          return this;
      }

      public CmsRelationCriteria andRelationTypeGreaterThan(java.lang.String value) {
          addCriterion("relation_type", value, ConditionMode.GREATER_THEN, "relationType", "java.lang.String", "String");
          return this;
      }

      public CmsRelationCriteria andRelationTypeGreaterThanOrEqualTo(java.lang.String value) {
          addCriterion("relation_type", value, ConditionMode.GREATER_EQUAL, "relationType", "java.lang.String", "String");
          return this;
      }

      public CmsRelationCriteria andRelationTypeLessThan(java.lang.String value) {
          addCriterion("relation_type", value, ConditionMode.LESS_THEN, "relationType", "java.lang.String", "String");
          return this;
      }

      public CmsRelationCriteria andRelationTypeLessThanOrEqualTo(java.lang.String value) {
          addCriterion("relation_type", value, ConditionMode.LESS_EQUAL, "relationType", "java.lang.String", "String");
          return this;
      }

      public CmsRelationCriteria andRelationTypeBetween(java.lang.String value1, java.lang.String value2) {
    	  addCriterion("relation_type", value1, value2, ConditionMode.BETWEEN, "relationType", "java.lang.String", "String");
    	  return this;
      }

      public CmsRelationCriteria andRelationTypeNotBetween(java.lang.String value1, java.lang.String value2) {
          addCriterion("relation_type", value1, value2, ConditionMode.NOT_BETWEEN, "relationType", "java.lang.String", "String");
          return this;
      }
        
      public CmsRelationCriteria andRelationTypeIn(List<java.lang.String> values) {
          addCriterion("relation_type", values, ConditionMode.IN, "relationType", "java.lang.String", "String");
          return this;
      }

      public CmsRelationCriteria andRelationTypeNotIn(List<java.lang.String> values) {
          addCriterion("relation_type", values, ConditionMode.NOT_IN, "relationType", "java.lang.String", "String");
          return this;
      }
	public CmsRelationCriteria andCreateTimeIsNull() {
		isnull("create_time");
		return this;
	}
	
	public CmsRelationCriteria andCreateTimeIsNotNull() {
		notNull("create_time");
		return this;
	}
	
	public CmsRelationCriteria andCreateTimeIsEmpty() {
		empty("create_time");
		return this;
	}

	public CmsRelationCriteria andCreateTimeIsNotEmpty() {
		notEmpty("create_time");
		return this;
	}
       public CmsRelationCriteria andCreateTimeEqualTo(java.util.Date value) {
          addCriterion("create_time", value, ConditionMode.EQUAL, "createTime", "java.util.Date", "String");
          return this;
      }

      public CmsRelationCriteria andCreateTimeNotEqualTo(java.util.Date value) {
          addCriterion("create_time", value, ConditionMode.NOT_EQUAL, "createTime", "java.util.Date", "String");
          return this;
      }

      public CmsRelationCriteria andCreateTimeGreaterThan(java.util.Date value) {
          addCriterion("create_time", value, ConditionMode.GREATER_THEN, "createTime", "java.util.Date", "String");
          return this;
      }

      public CmsRelationCriteria andCreateTimeGreaterThanOrEqualTo(java.util.Date value) {
          addCriterion("create_time", value, ConditionMode.GREATER_EQUAL, "createTime", "java.util.Date", "String");
          return this;
      }

      public CmsRelationCriteria andCreateTimeLessThan(java.util.Date value) {
          addCriterion("create_time", value, ConditionMode.LESS_THEN, "createTime", "java.util.Date", "String");
          return this;
      }

      public CmsRelationCriteria andCreateTimeLessThanOrEqualTo(java.util.Date value) {
          addCriterion("create_time", value, ConditionMode.LESS_EQUAL, "createTime", "java.util.Date", "String");
          return this;
      }

      public CmsRelationCriteria andCreateTimeBetween(java.util.Date value1, java.util.Date value2) {
    	  addCriterion("create_time", value1, value2, ConditionMode.BETWEEN, "createTime", "java.util.Date", "String");
    	  return this;
      }

      public CmsRelationCriteria andCreateTimeNotBetween(java.util.Date value1, java.util.Date value2) {
          addCriterion("create_time", value1, value2, ConditionMode.NOT_BETWEEN, "createTime", "java.util.Date", "String");
          return this;
      }
        
      public CmsRelationCriteria andCreateTimeIn(List<java.util.Date> values) {
          addCriterion("create_time", values, ConditionMode.IN, "createTime", "java.util.Date", "String");
          return this;
      }

      public CmsRelationCriteria andCreateTimeNotIn(List<java.util.Date> values) {
          addCriterion("create_time", values, ConditionMode.NOT_IN, "createTime", "java.util.Date", "String");
          return this;
      }
	public CmsRelationCriteria andAssociatedTypeIsNull() {
		isnull("associated_type");
		return this;
	}
	
	public CmsRelationCriteria andAssociatedTypeIsNotNull() {
		notNull("associated_type");
		return this;
	}
	
	public CmsRelationCriteria andAssociatedTypeIsEmpty() {
		empty("associated_type");
		return this;
	}

	public CmsRelationCriteria andAssociatedTypeIsNotEmpty() {
		notEmpty("associated_type");
		return this;
	}
        public CmsRelationCriteria andAssociatedTypeLike(java.lang.String value) {
    	   addCriterion("associated_type", value, ConditionMode.FUZZY, "associatedType", "java.lang.String", "String");
    	   return this;
      }

      public CmsRelationCriteria andAssociatedTypeNotLike(java.lang.String value) {
          addCriterion("associated_type", value, ConditionMode.NOT_FUZZY, "associatedType", "java.lang.String", "String");
          return this;
      }
      public CmsRelationCriteria andAssociatedTypeEqualTo(java.lang.String value) {
          addCriterion("associated_type", value, ConditionMode.EQUAL, "associatedType", "java.lang.String", "String");
          return this;
      }

      public CmsRelationCriteria andAssociatedTypeNotEqualTo(java.lang.String value) {
          addCriterion("associated_type", value, ConditionMode.NOT_EQUAL, "associatedType", "java.lang.String", "String");
          return this;
      }

      public CmsRelationCriteria andAssociatedTypeGreaterThan(java.lang.String value) {
          addCriterion("associated_type", value, ConditionMode.GREATER_THEN, "associatedType", "java.lang.String", "String");
          return this;
      }

      public CmsRelationCriteria andAssociatedTypeGreaterThanOrEqualTo(java.lang.String value) {
          addCriterion("associated_type", value, ConditionMode.GREATER_EQUAL, "associatedType", "java.lang.String", "String");
          return this;
      }

      public CmsRelationCriteria andAssociatedTypeLessThan(java.lang.String value) {
          addCriterion("associated_type", value, ConditionMode.LESS_THEN, "associatedType", "java.lang.String", "String");
          return this;
      }

      public CmsRelationCriteria andAssociatedTypeLessThanOrEqualTo(java.lang.String value) {
          addCriterion("associated_type", value, ConditionMode.LESS_EQUAL, "associatedType", "java.lang.String", "String");
          return this;
      }

      public CmsRelationCriteria andAssociatedTypeBetween(java.lang.String value1, java.lang.String value2) {
    	  addCriterion("associated_type", value1, value2, ConditionMode.BETWEEN, "associatedType", "java.lang.String", "String");
    	  return this;
      }

      public CmsRelationCriteria andAssociatedTypeNotBetween(java.lang.String value1, java.lang.String value2) {
          addCriterion("associated_type", value1, value2, ConditionMode.NOT_BETWEEN, "associatedType", "java.lang.String", "String");
          return this;
      }
        
      public CmsRelationCriteria andAssociatedTypeIn(List<java.lang.String> values) {
          addCriterion("associated_type", values, ConditionMode.IN, "associatedType", "java.lang.String", "String");
          return this;
      }

      public CmsRelationCriteria andAssociatedTypeNotIn(List<java.lang.String> values) {
          addCriterion("associated_type", values, ConditionMode.NOT_IN, "associatedType", "java.lang.String", "String");
          return this;
      }
}